package pacBioSimple;

import pacBiopackage.GetOpt;

public class PacBioMergeLinkerSequenceMain {

	
	public static void main(String[] args) {
		GetOpt go = new GetOpt(args, "o:i:b:h");
		go.optErr = true;
		int ch = -1;
		
		// process options in command line arguments
		// Set default values
		boolean usagePrint = false;                 
		String filenameInputPacBioFasta = "";
		String filenameOutput="output.txt";
		while ((ch = go.getopt()) != GetOpt.optEOF) 
		{
		    if ((char)ch == 'h') {
		       usagePrint = true;
		   }
		    else if ((char)ch == 'i') {
		    	filenameInputPacBioFasta = go.optArgGet();
		    }
		    else if((char)ch =='o')
		    {
		    	filenameOutput = go.optArgGet();
		    }
		    else
		        System.exit(1);                     // undefined option
		}                                           // getopt() returns '?'
		
		if (usagePrint || filenameInputPacBioFasta.isEmpty() || filenameOutput.isEmpty()) {
		    System.out.println("Usage: -i PacBio_linker_hit [ -o outputFile -h]"); //NOI18N
		    System.exit(0);
		}
		
		// @TODO check if files exist
	
		System.out.println("------------------------");
		System.out.println("Command line parameter settings:");
		System.out.println("-i " + filenameInputPacBioFasta); //NOI18N
		System.out.println("-o " + filenameOutput); //NOI18N		
		System.out.println("------------------------");
		
		PacBioMerger merger = new PacBioMerger(filenameInputPacBioFasta, filenameOutput);

		merger.read();
	}
}
